package cn.dbqn.controller;

import cn.dbqn.entity.Dieout;
import cn.dbqn.service.DieoutService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class DieoutController {
    @Resource
    DieoutService dieoutService;

    @RequestMapping("/listtt")
    public String list(Model model){
        List<Dieout> list=dieoutService.findAllTt();
        model.addAttribute("list",list);
        return "lyear_pages_gallery";
    }

    @ResponseBody
    @RequestMapping("ttxx")
    public Object ttxx(@RequestParam("dieoutNo")Integer dieoutNo){
        Dieout ttxx=dieoutService.ttxx(dieoutNo);
        return ttxx;
    }
}
